package stigtest.controller;
import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import stigtest.service.MyService;

@Controller  
@RequestMapping("/")  
public class HelloWorldController {  
   
	@Resource(name="myService")
	private MyService myService;
	
    @RequestMapping(method = RequestMethod.GET)  
    public String sayHello(ModelMap model) {  
        model.addAttribute("greeting", "Hello World from Spring 4 MVC");  
        myService.service();
        
        return "welcome";  
    }  
   
    @RequestMapping(value="/helloagain", method = RequestMethod.GET)  
    public String sayHelloAgain(ModelMap model) {  
        model.addAttribute("greeting", "Hello World Again, from Spring 4 MVC");  
        myService.service();
        return "welcome";  
    }  
   
}  